-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Improve Engagement Dashboard's "Channels" tab performance #32493
feat: Improve Engagement Dashboard's "Channels" tab performance #32493
Conversation
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: f3ca6f0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 32 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #32493 +/- ##
===========================================
- Coverage 55.58% 55.52% -0.06%
===========================================
Files 2634 2634
Lines 57281 57255 -26
Branches 11861 11858 -3
===========================================
- Hits 31838 31790 -48
- Misses 22750 22770 +20
- Partials 2693 2695 +2
Flags with carried forward coverage won't be shown. Click here to find out more. |
Co-authored-by: Kevin Aleman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
༼ つ ◕_◕ ༽つ API tests
@matheusbsilva137 since adjusting the aggregation as part of improving can you please attach the mongo explain of the query before the optimization and after? ideally with some real amount of data being processed so we can get an idea if the query is going to utilize appropriate indexes and be any better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just attached the old and new aggregations explains to the PR description.
The new aggregation uses the t
index for rooms, while the old one doesn't use indexes at all (based on what Compass told me 🤓 ). For now I'm using my local env, which doesn't have that much data, but we're planning to run this on a bigger DB for testing before this is merged.
Thanks for adding 🙏 this sort of data is important. Might be worth just creating a bunch of records. We should make it easier to fake a lot of data for optimizations like this. Having to wait on larger environments seems like adding in delays that we could avoid |
…nto feat/improve-engagement-dashboard-chanels
Proposed changes (including videos or screenshots)
limit
as soon as possible in the aggregation so as to carry less data to the next steps;hideRoomsWithNoActivity
param to theengagement-dashboard/channels/list
endpoint, which enables a faster search by not returning rooms that had no message sent in the given period. This param is being used astrue
by default in our client, which will be the default behavior starting on 7.0 (when this param will be removed).Issue(s)
Steps to test or reproduce
The Engagement Dashboard's "Channels" tab should keep working just like before, but faster when there's a huge amount of rooms in the workspace. Channels should always be listed sorted by their amount of messages when no
sort
param is provided.What should be validated:
engagement-dashboard/channels/list
endpoint should be sorted by their amount of new messages in the analyzed timespan (decreasingly);engagement-dashboard/channels/list
endpoint should accept a new booleanhideRoomsWithNoActivity
param, which enables a faster search by removing rooms that had no messages sent in the analyzed timespan. This is specially relevant for workspaces that have a huge amount of rooms (this option is being used in the UI);engagement-dashboard/channels/list
endpoint is called (so that users are aware that the new param will be deprecated);engagement-dashboard/channels/list
endpoint anymore.Further comments
SUP-513
SUP-558
Aggregation explain (before): explain-aggregation-before.json
Aggregation explain (after): explain-aggregation-after.json
Aggregation explain (after and using hideRoomsWithNoActivity param): aggregation-explain-after-hide-rooms-with-no-activity.json